﻿namespace BloggerBackup.My
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.ApplicationServices;
    using Microsoft.VisualBasic.Devices;
    using System;
    using System.CodeDom.Compiler;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Windows.Forms;

    [EditorBrowsable(EditorBrowsableState.Never), GeneratedCode("MyTemplate", "8.0.0.0")]
    internal class MyApplication : WindowsFormsApplicationBase
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();

        [DebuggerStepThrough]
        public MyApplication() : base(AuthenticationMode.Windows)
        {
            base.UnhandledException += new Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventHandler(this.MyApplication_UnhandledException);
            base.Startup += new StartupEventHandler(this.MyApplication_Startup);
            base.NetworkAvailabilityChanged += new NetworkAvailableEventHandler(this.MyApplication_NetworkAvailabilityChanged);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.IsSingleInstance = false;
            this.EnableVisualStyles = true;
            this.SaveMySettingsOnExit = true;
            this.ShutdownStyle = ShutdownMode.AfterMainFormCloses;
        }

        [DebuggerHidden, STAThread, EditorBrowsable(EditorBrowsableState.Advanced)]
        internal static void Main(string[] Args)
        {
            try
            {
                Application.SetCompatibleTextRenderingDefault(WindowsFormsApplicationBase.UseCompatibleTextRendering);
            }
            finally
            {
            }
            MyProject.Application.Run(Args);
        }

        private void MyApplication_NetworkAvailabilityChanged(object sender, NetworkAvailableEventArgs e)
        {
            Trace.WriteLine("Network Availability Changed: Is Network Available =" + e.IsNetworkAvailable.ToString());
        }

        private void MyApplication_Startup(object sender, StartupEventArgs e)
        {
        }

        private void MyApplication_UnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
        {
            Trace.WriteLine("Unhandled Exception" + e.Exception.ToString());
            Interaction.MsgBox("Unhandled exception: " + e.Exception.Message, MsgBoxStyle.OkOnly, "Blogger Backup - Unhandled Exception");
            e.ExitApplication = false;
        }

        [DebuggerStepThrough]
        protected override void OnCreateMainForm()
        {
            this.MainForm = MyProject.Forms.MainForm;
        }
    }
}

